/**
 * Handles calls to the ui.
 * @author jon
 */

package manager;

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;

import ui.IdleScreen;

public class UIHandlerManager implements Runnable {
	private AgentManagerMIDlet midlet;
	private Display display;
	
	public UIHandlerManager(AgentManagerMIDlet midlet,Display display){
		//this.run();
		this.midlet = midlet;
		this.display = display;
	}

	public synchronized void run() {
        //Displayable current = Display.getDisplay(midlet).getCurrent();
        //if(current == null)
        
		ui.GetServerAddressScreen serverAddressScreen = new ui.GetServerAddressScreen(midlet,display);
		display.setCurrent(serverAddressScreen);
		/*ui.AgentCreationScreen creationScreen = 
            	new ui.AgentCreationScreen(midlet, "Please Select an Agent to create",display);
        display.setCurrent(creationScreen);
        */
	}

	public void setIdleScreen(){
		IdleScreen idleScreen = new IdleScreen(midlet,display);
		display.setCurrent(idleScreen);
	}

	
	
}
